package com.shanghaionstar.carmanage.adapter;


import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.onstar.cn.framework.annotation.FindViewById;
import com.onstar.cn.framework.base.CommonAdapter;
import com.onstar.cn.framework.base.CommonViewHolder;
import com.shanghaionstar.R;
import com.shanghaionstar.carmanage.model.CarCheckItem;

import java.util.List;

/**
 * Created by Mengzhou Gu on 2016/7/26.
 */
public class CarCheckMainAdapter extends CommonAdapter<CarCheckItem> {

    public CarCheckMainAdapter(List datas, Context context) {

        super(datas, context);
    }

    @Override
    public void getView(int position, CommonViewHolder viewHolder) {
        ViewHolder holder=(ViewHolder)viewHolder;
        CarCheckItem carCheckItem = datas.get(position);
        holder.carcheck_advice_title.setText(carCheckItem.title);
        holder.carcheck_advice_content.setText(carCheckItem.content);
        holder.carcheck_icon.setImageResource(carCheckItem.icon);
    }

    @Override
    public int layoutId() {
        return R.layout.carcheckmaintain_item;
    }

    @Override
    public CommonViewHolder getViewHolder() {
        return new ViewHolder();
    }


    private class ViewHolder extends CommonViewHolder{
        @FindViewById
        public ImageView carcheck_icon;
        @FindViewById
        public TextView carcheck_advice_title,carcheck_advice_content;
    }
}
